Skip to content

fix: resolve theme-switching crash and add automated UI action tests across all tabs - #55

Merged
spelech merged 3 commits into
mainfrom
fix/theme-switching-crash-and-ui-interaction-tests
Sep 13, 2026
Merged

fix: resolve theme-switching crash and add automated UI action tests across all tabs#55
spelech merged 3 commits into
mainfrom
fix/theme-switching-crash-and-ui-interaction-tests

Conversation

@spelech

@spelech spelech commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Summary of Changes

  • Theme Switching Crash Fix:
    • Identified root cause of crash when switching framework theme styles: dynamically modifying \Current.Styles\ (\Styles.Clear()) broke visual trees containing Avalonia 11 \ScrollViewer\ controls.
    • Converted \SetThemeStyle\ in both Desktop (\App.axaml.cs) and Web (\LocalLLMServerManager.Web/App.axaml.cs) to a safe non-destructive implementation that keeps base design system styles intact and cleanly toggles theme palettes (\MatteCarbon\ vs. \OledBlack) via \ThemeService.
    • Added UI thread dispatch verification in \ThemeService.SetTheme\ to prevent thread affinity violations when invoked from non-UI threads.
    • Added cross-assembly resolution in \SettingsViewModel.SwitchThemeStyle\ supporting Desktop, Web, and headless test runners.
  • Automated Headless UI Action Tests:
    • Added full interaction tests across all UI tabs, pickers, and actions in \AvaloniaHeadlessInteractionTests.cs:
      • Settings tab: dynamic theme ComboBox, framework theme buttons, tool discovery, status refresh, video/audio pack toggles, and preset manager actions (create, filter, reset, JSON export/import).
      • Telemetry header: status refresh and hardware telemetry readouts.
      • Engine Studio tab: Test Flight modal toggle, engine selectors, and preset bar controls.
      • Ollama tab: context token slider, VRAM unload, filter pills, and model deletion confirmation flow.
      • Hub tabs (HuggingFace & Civitai): search queries, modality presets, filter tags, and VRAM fit verdict filters.
    • Switched \StudioControlInstantiationTests\ to [AvaloniaFact]\ for proper UI dispatcher affinity.
  • WASM Sync:
    • Synced compiled WebAssembly distribution binaries in \wwwroot/_framework/.

Verification

  • Headless UI tests: \20 passed, 0 failed.
  • Solution test suite: \584 passed, 0 failed\ (1 skipped doc screenshot generator).
  • Linter:
    pm run lint\ passed with 0 errors.
  • Typechecker:
    px tsc --noEmit\ passed with 0 errors.

@spelech
spelech merged commit 18332d2 into main Sep 13, 2026
2 checks passed
@spelech
spelech deleted the fix/theme-switching-crash-and-ui-interaction-tests branch September 13, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant